package com.sai.jsai.module.auth.handler;

import cn.dev33.satoken.exception.NotLoginException;
import com.sai.jsai.common.base.vo.RestResult;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author jisai
 * @version 0.0.1
 * @Description TODO
 * @createTime 2024/09/23
 */
@RestControllerAdvice
public class AuthExceptionHandler {

    // 拦截：未登录异常
    @ExceptionHandler(NotLoginException.class)
    public RestResult handlerException(NotLoginException e) {
        return RestResult.error(AuthErrorCode.NOT_LOGIN);
    }

}
